-- GENERATED SPELL FOR [Unholy Staff] --


function spell0_16215(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(28450,pUnit)
pUnit:RegisterEvent('Sorts_16215', 500, 1)
end

function spell1_16215(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(55467,pUnit)
pUnit:RegisterEvent('Sorts_16215', 500, 1)
end

function spell2_16215(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(29849,pUnit)
pUnit:RegisterEvent('Sorts_16215', 6334, 1)
end

function spell3_16215(pUnit, Event) --@Polymorph,n/a--
pUnit:FullCastSpellOnTarget(29848,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16215', 10271, 1)
end

function Sorts_16215(pUnit, Event)
local choix_sorts_16215 = math.random(0, 3)
if choix_sorts_16215 == 0 then
pUnit:RegisterEvent('spell0_16215', 1, 1)
end
if choix_sorts_16215 == 1 then
pUnit:RegisterEvent('spell1_16215', 1, 1)
end
if choix_sorts_16215 == 2 then
pUnit:RegisterEvent('spell2_16215', 1, 1)
end
if choix_sorts_16215 == 3 then
pUnit:RegisterEvent('spell3_16215', 1, 1)
end
end

function mob16215_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16215', math.random(1500, 3000), 1)
end

function mob16215_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16215_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16215_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16215, 1, 'mob16215_Action')
RegisterUnitEvent(16215, 2, 'mob16215_Leave')
RegisterUnitEvent(16215, 3, 'mob16215_Kill')
RegisterUnitEvent(16215, 4, 'mob16215_Die')
